home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / dhcp3-client.postrm < prev    next >
Text File  |  2009-10-08  |  2KB  |  67 lines

  1. #!/bin/sh -e
  2. #
  3. # $Id: dhcp3-client.postrm,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
  4. #
  5.  
  6. # Undo removal of a no-longer used conffile
  7. undo_rm_conffile()
  8. {
  9.     CONFFILE="$1"
  10.  
  11.     if [ ! -e "$CONFFILE" ]; then
  12.     if [ -e "$CONFFILE".dpkg-bak ]; then
  13.         echo "Restoring modified conffile $CONFFILE"
  14.         mv -f "$CONFFILE".dpkg-bak "$CONFFILE"
  15.     elif [ -e "$CONFFILE".dpkg-obsolete ]; then
  16.         mv -f "$CONFFILE".dpkg-obsolete "$CONFFILE"
  17.     fi
  18.     fi
  19. }
  20.  
  21. # Finish removal of a no-longer used conffile
  22. finish_rm_conffile()
  23. {
  24.     CONFFILE="$1"
  25.  
  26.     if [ -e "$CONFFILE".dpkg-bak ]; then
  27.     rm -f "$CONFFILE".dpkg-bak
  28.     fi
  29. }
  30.  
  31. case "$1" in
  32.     purge)
  33.     # Remove lease database
  34.     rm -f /var/lib/dhcp3/dhclient.leases*
  35.  
  36.     # Try to remove directory
  37.     if [ -d /var/lib/dhcp3 ]; then
  38.         rmdir --ignore-fail-on-non-empty /var/lib/dhcp3/
  39.     fi
  40.  
  41.     if [ -e /etc/dhcp3/dhclient-script ]; then
  42.         rm /etc/dhcp3/dhclient-script
  43.         rmdir --ignore-fail-on-non-empty /etc/dhcp3
  44.     fi
  45.  
  46.     rm -f /etc/apparmor.d/force-complain/sbin.dhclient3 >/dev/null 2>&1 || true
  47.  
  48.     if dpkg --compare-versions "$2" lt-nl 3.1.2-1ubuntu7; then
  49.         finish_rm_conffile /etc/network/if-pre-up.d/dhclient3-apparmor
  50.     fi
  51.     ;;
  52.  
  53.     abort-install|abort-upgrade)
  54.     if dpkg --compare-versions "$2" lt-nl 3.1.2-1ubuntu7; then
  55.         undo_rm_conffile /etc/network/if-pre-up.d/dhclient3-apparmor
  56.     fi
  57.     ;;
  58. esac
  59.  
  60. # Automatically added by dh_installdebconf
  61. if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
  62.     . /usr/share/debconf/confmodule
  63.     db_purge
  64. fi
  65. # End automatically added section
  66.  
  67.